package com.myres.util;

import com.admic.model.jmail.Account;
import com.admic.model.jmail.EMailSender;
import com.admic.model.jmail.MyMessage;

public class EmailTool {
	public static synchronized boolean sendEmail(String receiver,String subject,String content){
		   Account account =new Account();
	       account.setDisplayName("market");
	       account.setEmailAddress("j383575602@qq.com");
	       account.setOutEmailAddress("j383575602@qq.com");
	       account.setOutUserName("j383575602");
	       account.setOutPassword("sd09720475");
	       account.setOutProtocol("smtp");
	       account.setOutPort(465);
	       account.setOutServer("smtp.qq.com");
		   EMailSender sender=	new EMailSender(account);
		   try{
			   MyMessage message=new MyMessage();
			   message.setTo(receiver);
			   message.setSubject(subject);
			   message.setContent(content);
			   sender.send(message);
			   return true;
		   }catch(Exception e){
			   e.printStackTrace();
			   return false;
		   }
	   }

}
